package com.yinhai.mycat_test.mapper.write;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yinhai.mycat_test.entity.Order;

import java.util.List;

import org.apache.ibatis.annotations.Param;

public interface OrderWriteMapper extends BaseMapper<Order> {
    /**
     * 插入订单
     * */
    int insertOrder(Order order);
    /**
     * 批量插入订单
     * */
    int batchInsertOrder(List<Order> orders);
    /**
     * 更新订单
     * */
    int updateOrder(Order order);

    /**
     * 批量删除订单
     * */
    int batchDeleteOrders(@Param("ids") List<Long> ids, @Param("userId") Long userId);
    /**
     * 删除订单
     * */
    int deleteOrderByOrderId(Long id);
    
    /**
     * 根据订单id和用户id删除订单
     *
     * @param orderId
     * @param userId
     * @return
     */
    int deleteOrderByOrderIdAndUserId(Long orderId,Long userId);
    
    void truncateOrder();
    
}
